<!--
/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * Copyright 2014 The moOde audio player project / Tim Curtis
 *
 * 汉化：Androidnews
 *
*/
-->
<div id="container">
<div class="container">
	<h1 class="net-config">网络</h1>

    <form class="form-horizontal" action="" method="post">
		<legend>Ethernet
			<button class="legend-config btn btn-medium btn-primary btn-submit" type="submit" name="save" value="1">保存</button>
		</legend>
		<p class="sub-legend">
			以太网有线连接提供了最大的性能和可靠性,并且通常不受大多数类型的电气和射频干扰的影响,这些干扰通常在住宅路由器和网络交换机所在的环境中发现.
		</p>

		<div class="control-group" >
			<label class="control-label" for="eth0method">地址配置</label>
			<div class="controls">
				<select id="eth0method" name="eth0method" class="config-select-large">
					$_eth0method
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-eth0method" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span class="config-help-static">
					$_eth0currentip
				</span>
				<span id="info-eth0method" class="config-help-info">
                	IP address assignment method.
                </span>
			</div>

			<div id="eth0-static-section" class="class=control-group hide">
				<label class="control-label" for="eth0ip">地址</label>
				<div class="controls">
					<input class="config-input-large" type="text" id="eth0ip" name="eth0ipaddr" value="$_eth0ipaddr">
				</div>

				<label class="control-label" for="eth0-netmask">掩码</label>
				<div class="controls">
					<select id="eth0-netmask" name="eth0netmask" class="config-select-large">
						$_eth0netmask
					</select>
				</div>

				<label class="control-label" for="eth0gateway">网关</label>
				<div class="controls">
					<input class="config-input-large" type="text" id="eth0gateway" name="eth0gateway" value="$_eth0gateway">
				</div>

				<label class="control-label" for="eth0pridns">主DNS</label>
				<div class="controls">
					<input class="config-input-large" type="text" id="eth0pridns" name="eth0pridns" value="$_eth0pridns">
				</div>

				<label class="control-label" for="eth0secdns">从DNS</label>
				<div class="controls">
					<input class="config-input-large" type="text" id="eth0secdns" name="eth0secdns" value="$_eth0secdns">
				</div>
			</div>
		</div>

		<legend>Wireless
			<button class="legend-config btn btn-medium btn-primary btn-submit" type="submit" name="save" value="1">保存</button>
		</legend>
		<p class="sub-legend">
			5Ghz频段上的无线网络通常比2.4GHz频段上的无线网络性能更好,因为其拥塞和来自其他网络的干扰更少.
		</p>

		<div class="control-group" >
			<label class="control-label" for="wlan0method">地址配置</label>
			<div class="controls">
				<select id="wlan0method" name="wlan0method" class="config-select-large">
					$_wlan0method
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-wlan0method" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span class="config-help-static">
					$_wlan0stats
				</span>
				<span id="info-wlan0method" class="config-help-info">
                	IP address assignment method, connected SSID, link quality and signal level.
                </span>
			</div>

			<label class="control-label" for="wlan0ssid">无线SSID</label>
			<div class="controls">
				<select id="wlan0ssid" name="wlan0ssid" class="config-select-large">
					$_wlan0ssid
				</select>
				<button class="btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="scan" value="1">扫描</button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-wlan0ssid" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-wlan0ssid" class="config-help-info">
					SCAN generates a list of available networks.
                </span>
			</div>

			<label class="control-label" for="wlan0pwd">密码</label>
			<div class="controls">
				<input class="config-input-large" type="password" pattern=".{8,64}" id="wlan0pwd" name="wlan0pwd" value="$_wlan0pwd">
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-wlan0pwd" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<a class="show-hide-password" href="#notarget" data-id="wlan0pwd"><i class="fa-regular fa-sharp fa-eye"></i></a>
				<span id="info-wlan0pwd" class="config-help-info">
                	Length 8-63 characters. The password will be converted to a pre-shared key (PSK) after saving.
                </span>
			</div>

			<label class="control-label" for="wlan0country">国家</label>
			<div class="controls">
				<select id="wlan0country" name="wlan0country" class="config-select-large">
					$_wlan0country
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-wlan0country" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-wlan0country" class="config-help-info">
					The country code determines what frequency bands are available.
                </span>
			</div>

			<div class="controls">
				<a data-toggle="modal" href="#manual-ssid"><button class="btn btn-medium btn-primary config-btn">确认</button></a>
				<span class="config-btn-after">手动添加SSID</span>
			</div>

			<div class="controls">
				<a data-toggle="modal" href="#manage-saved-networks"><button class="btn btn-medium btn-primary config-btn">管理</button></a>
				<span class="config-btn-after">保存网络</span>
			</div>
		</div>

		<div id="wlan0-static-section" class="control-group hide">
			<label class="control-label" for="wlan0ipaddr">地址</label>
			<div class="controls">
				<input class="config-input-large" type="text" id="wlan0ipaddr" name="wlan0ipaddr" value="$_wlan0ipaddr">
			</div>

			<label class="control-label" for="wlan0netmask">掩码</label>
			<div class="controls">
				<select id="wlan0netmask" name="wlan0netmask" class="config-select-large">
					$_wlan0netmask
				</select>
			</div>

			<label class="control-label" for="wlan0gateway">网关</label>
			<div class="controls">
				<input class="config-input-large" type="text" id="wlan0gateway" name="wlan0gateway" value="$_wlan0gateway">
			</div>

			<label class="control-label" for="wlan0pridns">主DNS</label>
			<div class="controls">
				<input class="config-input-large" type="text" id="wlan0pridns" name="wlan0pridns" value="$_wlan0pridns">
			</div>

			<label class="control-label" for="wlan0secdns">从DNS</label>
			<div class="controls">
				<input class="config-input-large" type="text" id="wlan0secdns" name="wlan0secdns" value="$_wlan0secdns">
			</div>
		</div>

		<legend>热点
			<button class="legend-config btn btn-medium btn-primary btn-submit" type="submit" name="save" value="1">保存</button>
		</legend>
		<p class="sub-legend">
			热点提供一个桥接到以太网连接的2.4 GHz WiFi网络(如果有的话).<br>
			地址: <b>$_ap_host</b> or <b>$_ap_network</b>
		</p>

		<div class="control-group">
	        <label class="control-label" for="apdssid">热点SSID</label>
	        <div class="controls">
	            <input class="config-input-large" type="text" pattern="[A-Za-z0-9\-]{3,32}" id="apdssid" name="wlan0apdssid" value="$_wlan0apdssid" required>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-apdssid" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-apdssid" class="config-help-info">
					Length 3-32 characters, A-Z, a-z, 0-9, and hyphen are allowed.
				</span>
	        </div>

            <label class="control-label" for="apdpwd">密码</label>
            <div class="controls">
                <input class="config-input-large" type="password" pattern=".{8,64}" id="apdpwd" name="wlan0apdpwd" value="$_wlan0apdpwd">
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-apdpwd" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<a class="show-hide-password" href="#notarget" data-id="apdpwd"><i class="fa-regular fa-sharp fa-eye"></i></a>
				<span id="info-apdpwd" class="config-help-info">
					Length 8-63 characters. The password will be converted to a pre-shared key (PSK) after saving.
				</span>
            </div>
        </div>
	</form>
</div>
</div>

<form class="form-horizontal" method="post">
	<div id="net-config-defaults" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="net-config-defaults-label" aria-hidden="true">
		<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button></div>
		<div class="modal-body"><h3>将网络配置重置为以太网和DHCP?</h3></div>
		<div class="modal-footer">
			<button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
			<button class="btn btn-primary btn-submit" type="submit" name="reset" value="1">确认</button>
		</div>
	</div>
</form>

<form class="form-horizontal" method="post">
	<div id="manual-ssid" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="manual-ssid-label" aria-hidden="true">
		<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			<h3>手动输入SSID</h3>
		</div>
		<div class="modal-body">
			<div class="control-group">
				<label class="control-label" for="wlan0otherssid">SSID</label>
				<div class="controls">
					<input class="config-input-large config-modal-input" type="text" pattern="[A-Za-z0-9\-_ .@]{3,32}" id="wlan0otherssid" name="wlan0otherssid" value="" autofocus>
					<a aria-label="Help" class="config-info-toggle" data-cmd="info-manualssid" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
					<span id="info-manualssid" class="config-help-info">
                    	Length 3-32 characters, A-Z, a-z, 0-9, space, period, at sign, underscore and hyphen are allowed.
                    </span>
				</div>
			</div>
		</div>
		<div class="modal-footer">
			<button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
			<button class="btn btn-primary btn-submit" type="submit" name="manualssid" value="1">确认</button>
		</div>
	</div>
</form>

<form class="form-horizontal" method="post">
	<div id="manage-saved-networks" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="manage-saved-networks-label" aria-hidden="true">
		<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			<h3>管理保存的网络</h3>
		</div>
		<div class="modal-body">
			<div class="form-horizontal">
				$_saved_networks
			</div>
		</div>
		<div class="modal-footer">
			<button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
			<button class="btn btn-primary btn-submit" type="submit" name="update-saved-networks" value="1">更新</button>
		</div>
	</div>
</form>
